<script lang="ts" setup>
import { ref } from 'vue';
import { useRouter } from 'vue-router';

import { runLententMsg } from '@vben/utils';

import { Modal } from 'ant-design-vue';

import { auto1688stor } from '#/store';

const appkey = import.meta.env.VITE_APP_1688_ISV_APPKEY || '3332053';
const iframeurl = `https://air.1688.com/app/channel-fe/search/index.html#/result?isv_appkey=${appkey}&isv_distribute_mode=message`;
const auto1688storTres = auto1688stor();
const nowData = auto1688storTres.auto1688.nowSelectDyShop;
const buyLink = import.meta.env.VITE_APP_BUY_DOUDIAN_LINK;
const showAddBox = ref(false);
const in1688ItemIds = ref([]);
// const dataInxiayou = auto1688storTres.auto1688.bindShopList?.filter(
//   (item) => item.pType === 1 && item.isUseing === 1 && item.status === 1,
// );
const router = useRouter();


runLententMsg('1688air', (e: any) => {
 
 
  in1688ItemIds.value = e.data.data['1688_item_id'].split(',');

  if(in1688ItemIds.value.length>0){
     console.log('in1688ItemIds.length', in1688ItemIds.value.length);
    showAddBox.value = true;
  }else{
    showAddBox.value = false;
  }


});
</script>

<template>
  <div class="h-full w-full">
    <iframe :src="iframeurl" height="100%" width="100%"> </iframe>
    <set-add-product-box
      v-if="showAddBox"
      v-model="showAddBox"
      :select-item-list="in1688ItemIds"
    />
  </div>
</template>
